package edu.lit.cn.controller;

import com.alibaba.fastjson.JSON;
import edu.lit.cn.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;

@RestController
public class TestController {
    @Autowired
    TestService testService;
    @GetMapping("getAllFromTableT_device")
    public String getAllFromTable(){
        ArrayList<HashMap<String, Object>> all = testService.getAll();
        return JSON.toJSONString(all);
    }

}
